function removeElement(nums: number[], val: number): number {
    let length = nums.length,
        j = 0
    for(let i = 0;i<length;i++){
        if(nums[i]!==val){
            nums[j++]=nums[i]
        }
    }
    return j
};